package com.ruoyi.project.comp.h5;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.comp.like.domain.CompLike;
import com.ruoyi.project.comp.like.service.ICompLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 作品点赞记录Controller
 * 
 * @author ruoyi
 * @date 2025-11-02
 */
@Controller
@RequestMapping("/h5/comp/like")
public class H5CompLikeController extends BaseController
{
    private String prefix = "h5/comp/like";

    @Autowired
    private ICompLikeService compLikeService;

    @GetMapping()
    public String like()
    {
        return prefix + "/like";
    }

    /**
     * 新增作品点赞记录
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 新增保存作品点赞记录
     */
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(CompLike compLike)
    {
        return toAjax(compLikeService.insertCompLike(compLike));
    }


}
